import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '@/views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/tuijian',
    children: [
      {
        path: '/tuijian',
        component: () => import('@/views/content/TuiJian.vue')
      },
      {
        path: '/jingyan',
        component: () => import('@/views/content/JingYanView.vue')
      },
      {
        path: '/gongxiao',
        component: () => import('@/views/content/GongXiaoView.vue')
      },
      {
        path: '/chongpao',
        component: () => import('@/views/content/ChongPaoView.vue')
      },
      {
        path: '/cunfang',
        component: () => import('@/views/content/CunFangView.vue')
      },
      {
        path: '/jinji',
        component: () => import('@/views/content/JinJiView.vue')
      },
      {
        path: '/chaqi',
        component: () => import('@/views/content/ChaQiView.vue')
      },
      {
        path: '/wenhua',
        component: () => import('@/views/content/WenHuaView.vue')
      },
      {
        path: '/huacha',
        component: () => import('@/views/content/HuaChaView.vue')
      },
      {
        path: '/baike',
        component: () => import('@/views/content/BaiKeView.vue')
      },
      {
        path: '/article/details',
        component: () => import('@/views/content/ArticleDetails.vue')
      },
      {
        path: '/mall',
        component: () => import('@/views/mall/MallIndexView.vue')
      },
      {
        path: '/mall/commodity',
        component: () => import('@/views/mall/CommodityDetail.vue')
      },
      {
        path: '/mall/sameCommodity',
        component: () => import('@/views/mall/SameCommodityView.vue')
      },
      {
        path: '/mall/myOrderList',
        component: () => import('@/views/mall/MyOrderList.vue')
      },

      {
        path: '/mall/cartLayout',
        component: () => import('@/views/mall/CartLayout.vue')
      },
      {
        path: '/receiverAddresses',
        component: () => import('@/views/mall/ReceiverAddresses.vue')
      },
      {
        path: '/userAbout',
        component: () => import('@/views/mall/UserAbout.vue')
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router